import pymysql
db = pymysql.connect(host='localhost',port=3306,user='root', password='q7418520', db='sakila',charset='utf8')
cursor = db.cursor()
change_sql = ("DELETE FROM student WHERE id = 02")
try:
   cursor.execute(change_sql)
   print('Successful')
   db.commit()
except:
   print('Failed')
   db.rollback()
cursor.close()
db.close()
